Inaccuracy tests with SPEX

Basically, how bad of an approximation can we do to the interpolation and still get away with 10% accuracy to the grid points? 10K, 0.05 dex in logg and [Fe/H] ?

As a comparison we need a high quality spectrum generated using our normal interpolation methods.

Conclusion

The SPEX tests are different than the TRES tests. This is because we are going from R=500,000 to R=2000, and thus the convolve first then interpolate will bring out more errors. The interesting thing, though, is that the error from doing convolve-interpolate is a different spectrum than the interpolation envelope. This is good. It means that this might be simply like adding interpolation noise (that the GP should pick up) rather than actually adding in any specific bias.

Towards the 4000 Ang example, we might have to be careful about interpolating after convolution. In this case, it might be better to pre-sample the grid to higher resolution w/ the splines, then convolve.

The areas where the HA is much lower than the LA are generally also continuum regions. This is good news, too.


In [1]:
%matplotlib
import matplotlib.pyplot as plt
import numpy as np
from StellarSpectra.spectrum import DataSpectrum
from StellarSpectra.grid_tools import SPEX, HDF5Interface
from StellarSpectra.model import Model
from grid_accuracy import AccuracyComparison

from IPython.display import display


Using matplotlib backend: Qt4Agg

SPEX Spectra


In [2]:
myDataSpectrum = DataSpectrum.open("../../data/Gl51/Gl51.hdf5")
myInstrument = SPEX()

Perturbations about T=3000, logg=4.5, Z = -0.5


In [3]:
myComp = AccuracyComparison(myDataSpectrum, myInstrument, "../../libraries/PHOENIX_submaster_M.hdf5",
                            "../../libraries/PHOENIX_SPEX_2300.hdf5",
                            {"temp":3000, "logg":4.5, "Z":-0.5}, {"temp":30, "logg":0.1, "Z": 0.1})

fig = myComp.plot_quality()
display(fig)


Bounds of the grids are
HA {'Z': (-1.0, 0.5), 'temp': (2300, 5000), 'logg': (2.5, 5.5), 'alpha': (0.0, 0.0)}
LA {'Z': (-1.0, 0.5), 'temp': (2300, 4000), 'logg': (3.0, 5.0), 'alpha': (0.0, 0.0)}
Determine Chunk Log: Wl is 8192
Creating OrderModel 0
Wl is 736816
Grid stretches from 8051.96 to 24996.46
wl_FFT is 0.04050820997053779 km/s
Creating OrderModel 0
Spectrum is len  4315
Value at 3134 is  18733.1 0.533040045164

In [11]:
myComp = AccuracyComparison(myDataSpectrum, myInstrument, "../../libraries/PHOENIX_submaster_M.hdf5",
                            "../../libraries/PHOENIX_SPEX_2300.hdf5",
                            {"temp":3000, "logg":4.5, "Z":-0.5}, {"temp":10, "logg":0.05, "Z": 0.05})

fig = myComp.plot_quality()
display(fig)


Bounds of the grids are
HA {'temp': (2300, 5000), 'logg': (2.5, 5.5), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
LA {'temp': (2300, 4000), 'logg': (3.0, 5.0), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
Interface wave_grid is len  8192
is  [  7450.           7451.13864614   7452.2774663  ...,  26042.03894415
  26046.01916791  26050.        ]
Data stretches from 8051.96 24996.46
Determine Chunk Log: Wl is 8192
Creating OrderModel 0
Wl is 736816
Grid stretches from 8051.96 to 24996.46
wl_FFT is 0.04050820997053779 km/s
Creating OrderModel 0
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common

In [12]:
myComp = AccuracyComparison(myDataSpectrum, myInstrument, "../../libraries/PHOENIX_submaster_M.hdf5",
                            "../../libraries/PHOENIX_SPEX_2300.hdf5",
                            {"temp":3000, "logg":4.5, "Z":-0.5}, {"temp":1, "logg":0.01, "Z": 0.01})

fig = myComp.plot_quality()
display(fig)


Bounds of the grids are
HA {'temp': (2300, 5000), 'logg': (2.5, 5.5), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
LA {'temp': (2300, 4000), 'logg': (3.0, 5.0), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
Interface wave_grid is len  8192
is  [  7450.           7451.13864614   7452.2774663  ...,  26042.03894415
  26046.01916791  26050.        ]
Data stretches from 8051.96 24996.46
Determine Chunk Log: Wl is 8192
Creating OrderModel 0
Wl is 736816
Grid stretches from 8051.96 to 24996.46
wl_FFT is 0.04050820997053779 km/s
Creating OrderModel 0
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common

Perturbations about T=4000, logg=4.5, Z= -0.5


In [13]:
myComp = AccuracyComparison(myDataSpectrum, myInstrument, "../../libraries/PHOENIX_submaster_M.hdf5",
                            "../../libraries/PHOENIX_SPEX_2300.hdf5",
                            {"temp":4000, "logg":4.5, "Z":-0.5}, {"temp":30, "logg":0.1, "Z": 0.1})

fig = myComp.plot_quality()
display(fig)


Bounds of the grids are
HA {'temp': (2300, 5000), 'logg': (2.5, 5.5), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
LA {'temp': (2300, 4000), 'logg': (3.0, 5.0), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
Interface wave_grid is len  8192
is  [  7450.           7451.13864614   7452.2774663  ...,  26042.03894415
  26046.01916791  26050.        ]
Data stretches from 8051.96 24996.46
Determine Chunk Log: Wl is 8192
Creating OrderModel 0
Wl is 736816
Grid stretches from 8051.96 to 24996.46
wl_FFT is 0.04050820997053779 km/s
Creating OrderModel 0
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common

In [14]:
myComp = AccuracyComparison(myDataSpectrum, myInstrument, "../../libraries/PHOENIX_submaster_M.hdf5",
                            "../../libraries/PHOENIX_SPEX_2300.hdf5",
                            {"temp":4000, "logg":4.5, "Z":-0.5}, {"temp":10, "logg":0.05, "Z": 0.05})

fig = myComp.plot_quality()
display(fig)


Bounds of the grids are
HA {'temp': (2300, 5000), 'logg': (2.5, 5.5), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
LA {'temp': (2300, 4000), 'logg': (3.0, 5.0), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
Interface wave_grid is len  8192
is  [  7450.           7451.13864614   7452.2774663  ...,  26042.03894415
  26046.01916791  26050.        ]
Data stretches from 8051.96 24996.46
Determine Chunk Log: Wl is 8192
Creating OrderModel 0
Wl is 736816
Grid stretches from 8051.96 to 24996.46
wl_FFT is 0.04050820997053779 km/s
Creating OrderModel 0
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common

In [15]:
myComp = AccuracyComparison(myDataSpectrum, myInstrument, "../../libraries/PHOENIX_submaster_M.hdf5",
                            "../../libraries/PHOENIX_SPEX_2300.hdf5",
                            {"temp":4000, "logg":4.5, "Z":-0.5}, {"temp":1, "logg":0.01, "Z": 0.01})

fig = myComp.plot_quality()
display(fig)


Bounds of the grids are
HA {'temp': (2300, 5000), 'logg': (2.5, 5.5), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
LA {'temp': (2300, 4000), 'logg': (3.0, 5.0), 'Z': (-1.0, 0.5), 'alpha': (0.0, 0.0)}
Interface wave_grid is len  8192
is  [  7450.           7451.13864614   7452.2774663  ...,  26042.03894415
  26046.01916791  26050.        ]
Data stretches from 8051.96 24996.46
Determine Chunk Log: Wl is 8192
Creating OrderModel 0
Wl is 736816
Grid stretches from 8051.96 to 24996.46
wl_FFT is 0.04050820997053779 km/s
Creating OrderModel 0
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common
Deallocating Covariance Matrix
Deallocating GlobalCovarianceMatrix
Deallocating Common

In [ ]: